Skip to content

Simplify pinned-column wording, preserve demo page metadata, and remove tracked generated props file#4673

Merged
vnbaaij merged 11 commits intocopilot/research-fluentdatagrid-implementationfrom
copilot/update-pinoffsetpx-value
Apr 7, 2026
Merged

Simplify pinned-column wording, preserve demo page metadata, and remove tracked generated props file#4673
vnbaaij merged 11 commits intocopilot/research-fluentdatagrid-implementationfrom
copilot/update-pinoffsetpx-value

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

  • Inspect pinned-column validation, offset computation, tests, and docs
  • Remove the pixel-only pinned-width enforcement while keeping required-width and ordering validation
  • Update pinned-column comments and public documentation to describe rendered-width offset recomputation
  • Adjust DataGrid tests to cover non-pixel pinned widths and preserve ordering/required-width behavior
  • Restore/build/test the affected projects and confirm no build artifacts are committed

Comment on lines -1 to -5
---
title: Pinned columns
order: 0095
route: /DataGrid/PinnedColumns
---
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to stay in place. Is used for the demo site nav menu

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a0f46eb by restoring the page front matter (title and route) so the demo nav/menu registration stays intact.

Comment on lines +61 to +62
* Column resizing interacts correctly with sticky offsets — the JavaScript in
`FluentDataGrid.razor.ts` recalculates `left` / `right` values after every resize step via
`FluentDataGrid.razor.ts` recalculates start and end offset values after every resize step via
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too much detail. It is not necessary for the developer using the component to know this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in a0f46eb to remove the implementation detail and keep the note user-focused.

Copilot AI changed the title Simplify pinned-column wording to start/end and remove tracked generated props file Simplify pinned-column wording, preserve demo page metadata, and remove tracked generated props file Apr 4, 2026
Copilot AI requested a review from vnbaaij April 4, 2026 15:55
@vnbaaij vnbaaij marked this pull request as ready for review April 7, 2026 09:53
@vnbaaij vnbaaij requested a review from dvoituron as a code owner April 7, 2026 09:53
Copilot AI review requested due to automatic review settings April 7, 2026 09:53
@vnbaaij vnbaaij merged commit dff971a into copilot/research-fluentdatagrid-implementation Apr 7, 2026
1 check passed
@vnbaaij vnbaaij deleted the copilot/update-pinoffsetpx-value branch April 7, 2026 09:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates FluentDataGrid pinned-column behavior and documentation to use logical start/end pinning (LTR/RTL-friendly) and to allow non-pixel CSS widths by recomputing sticky offsets from rendered widths via JavaScript after render.

Changes:

  • Renamed pinned-column concepts from Left/Right to Start/End across code, CSS, tests, and docs, and switched sticky positioning to inset-inline-start/end.
  • Relaxed pinned-column width validation to require an explicit Width (not pixel-only) and added/updated tests accordingly.
  • Updated demo documentation/examples and ignored src/Core.Scripts/obj/ in .gitignore.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/Core/Components/DataGrid/FluentDataGridPinnedColumnTests.razor Updates pinned-column tests for Start/End + logical inset styles; adds non-px width render test.
tests/Core/Components/DataGrid/FluentDataGridPinnedColumnTests.FluentDataGrid_PinnedColumn_Snapshot.verified.razor.html Updates verified snapshot to new class names and logical inset styles.
src/Core/Enums/DataGridColumnPin.cs Renames enum values to Start/End with updated XML docs.
src/Core/Components/DataGrid/FluentDataGridCell.razor.cs Updates emitted CSS classes and inline sticky styles to logical start/end properties.
src/Core/Components/DataGrid/FluentDataGrid.razor.ts Updates offset recomputation logic to target Start/End pinned columns and logical inset properties.
src/Core/Components/DataGrid/FluentDataGrid.razor.css Renames pinned-column selectors to col-pinned-start/end and keeps separator/z-index rules aligned.
src/Core/Components/DataGrid/FluentDataGrid.razor.cs Updates pinned-column validation wording and switches from numeric pixel offsets to string offsets.
src/Core/Components/DataGrid/Columns/ColumnBase.razor.cs Replaces PinOffsetPx with PinOffset string and updates docs for new behavior.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/DataGrid/Pages/DataGridPinnedColumnsPage.md Updates pinned-columns docs to Start/End and to allow non-pixel widths; front matter changed.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/DataGrid/Examples/DataGridPinnedColumns.razor Updates demo example to Start/End pinning.
.gitignore Ignores src/Core.Scripts/obj/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 18 to +28
/// <summary>
/// The column is pinned to the left edge of the grid.
/// The column will remain visible when the user scrolls right.
/// The column is pinned to the start edge of the grid.
/// The column will remain visible when the user scrolls toward the end.
/// </summary>
Left,
Start,

/// <summary>
/// The column is pinned to the right edge of the grid.
/// The column will remain visible when the user scrolls left.
/// The column is pinned to the end edge of the grid.
/// The column will remain visible when the user scrolls toward the start.
/// </summary>
Right,
End,
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming enum members from Left/Right to Start/End is a source-breaking public API change for all consumers that reference DataGridColumnPin.Left/Right. Consider keeping Left and Right as [Obsolete] aliases (mapping to the same underlying numeric values as Start/End) to preserve backward compatibility, and add migration guidance if the rename is intentional.

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +35
.AddClass("col-pinned-start", Column?.Pin == DataGridColumnPin.Start)
.AddClass("col-pinned-end", Column?.Pin == DataGridColumnPin.End)
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

col-pinned-left/right class names were replaced with col-pinned-start/end. This is a breaking change for consumers who target the old class names in custom CSS/tests. If backward compatibility is required, consider emitting both the old and new class names for a transition period (or clearly documenting this as a breaking change/migration step).

Suggested change
.AddClass("col-pinned-start", Column?.Pin == DataGridColumnPin.Start)
.AddClass("col-pinned-end", Column?.Pin == DataGridColumnPin.End)
.AddClass("col-pinned-start", Column?.Pin == DataGridColumnPin.Start)
.AddClass("col-pinned-left", Column?.Pin == DataGridColumnPin.Start)
.AddClass("col-pinned-end", Column?.Pin == DataGridColumnPin.End)
.AddClass("col-pinned-right", Column?.Pin == DataGridColumnPin.End)

Copilot uses AI. Check for mistakes.
Comment on lines 562 to 566
/**
* Recalculates and applies the `left` / `right` inline offsets for every cell in each
* pinned column so that columns stack correctly against the grid edge after the initial
* render or after a column is resized.
*
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSDoc for UpdatePinnedColumnOffsets still says it recalculates left / right offsets, but the implementation now uses logical properties (insetInlineStart / insetInlineEnd). Update the comment to match the new behavior to avoid confusion for maintainers.

Copilot uses AI. Check for mistakes.
---
title: Pinned columns
order: 0095
route: /DataGrid/PinnedColumns
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page front matter removed order: 0095, but other DataGrid documentation pages still define order: for nav/menu sorting. If the demo site relies on this for stable ordering, restore the order value (or update the doc-nav logic accordingly).

Suggested change
route: /DataGrid/PinnedColumns
route: /DataGrid/PinnedColumns
order: 0095

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants